JCAT.Class.CheckDependClasses(['JCAT.MVC','JCAT.MVC.View']) ;

JCAT.MVC.View.IForm = function(){} ;

JCAT.MVC.View.IForm.prototype.GetFormName = function()
{
	return this._sFormName ;
}

JCAT.MVC.View.IForm.prototype.GetForm = function()
{
	sFormName = this.GetFormName() ;
	return (typeof(document.forms[sFormName])=='undefined') ?
					null: document.forms[sFormName] ;
}

JCAT.MVC.View.IForm.prototype.VerifyData = function ( bFull/*=false*/, bAlert/*=true*/ )
{
	if( typeof(bFull)=='undefined' )
	{
		bFull = false ;
	}
	if( typeof(bAlert)=='undefined' )
	{
		bAlert = true ;
	}
	
	bReturn = true ;
	for(var sUICtrlName in this._arrUICtrls )
	{
		aUICtrl = this._arrUICtrls[sUICtrlName] ;
		if( JCAT.Class.HasImplements(aUICtrl,JCAT.MVC.UICtrl.IForm) )
		{
			Result = aUICtrl.VerifyData() ;
			if(Result!==true)
			{
				if(bAlert)
				{
					alert(Result) ;
				}
				
				bReturn = false ;
				
				if(!bFull)
				{
					break ;
				}
			}
		}
	}
	
	return bReturn ;
}

JCAT.MVC.View.IForm.prototype.Submit = function()
{
	wndForm = this.GetForm() ;
	if(wndForm)
	{
		wndForm.submit() ;
	}
}
